/**************************************************************
 *@ProjectName: blweibo
 *@FileName: UnreadNum.java
 *@Date: 2011-5-30
 *@Copyright: 2011 www.hrbanlv.com Inc. All rights reserved.
 **************************************************************/
package com.zhiweibo.models;

import org.json.JSONObject;

/**
 * The Class UnreadNum.
 * 
 * @author SunHaibin
 * @since Android 1.6
 * @history 2011-5-30
 */
public class UnreadNum {

    /** The atmsg. */
    public static int atmsg = 0;

    /** The comment. */
    public static int comment = 0;

    /** The message. */
    public static int message = 0;

    /** The newfans. */
    public static int newfans = 0;

    /** The new_topic. */
    public static int new_topic = 0;

    /**
     * Instantiates a new unread num.
     */
    public UnreadNum() {
        atmsg = 0;
        comment = 0;
        message = 0;
        newfans = 0;
        new_topic = 0;
    }

    /**
     * Instantiates a new unread num.
     * 
     * @param js
     *            the js
     */
    public UnreadNum(JSONObject js) {
        atmsg = js.optInt("mentions");
        comment = js.optInt("comments");
        message = js.optInt("pm");
        newfans = js.optInt("fans");
        new_topic = js.optInt("new_topic");
    }

    /*
     * (non-Javadoc)
     * 
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        return "UnreadNum [atmsg=" + atmsg + ", comment=" + comment + ", message=" + message + ", newfans=" + newfans
                + "]";
    }

}